package org.spiderdesign.core.common;

public enum Position {
    development             (1,"软件开发"),

    testing                 (2,"测试");

    long code;
    String name;

    Position(long code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(long code){
        for (Position position : Position.values()) {
            if (position.code == code) {
                return position.name; // 匹配到则返回名称
            }
        }
        return null;
    }

    public static long getCode(String name) {
        for (Position position : Position.values()) {
            if (position.name.equals(name)) {
                return position.code;
            }
        }
        return -1;
    }

}
